import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export const constantRouterMap = [{
    redirect: '/login',
    path: '/',
    name: '首页',
    component: () =>
        import('@/views/layout/Layout.vue'),//先导入侧边浪顶部栏组件
    children: [{
        path: 'home',
        name: 'home',
        component: () =>
            import('@/views/home/index.vue'),
    },],
    meta: {
        hidden: true //是否隐藏不显示在侧边菜单栏
    }
}, {
    path: '/login',
    name: 'login',
    component: () =>
        import('@/views/login/index.vue'), //登录
    meta: {
        hidden: true
    }
}, {
    path: '/dictionary',
    component: () =>
        import('@/views/layout/Layout.vue'),
    children: [{
        path: '/dictionary',
        name: 'dictionary',
        component: () =>
            import('@/views/dictionary/index.vue')
    }],
    meta: {
        name: '字典列表',
    }
},
{
    path: '/frameData',
    component: () =>
        import('@/views/layout/Layout.vue'),
    children: [{
        path: '/frameData',
        name: 'frameData',
        component: () =>
            import('@/views/frameData/index.vue')
    }],
    meta: {
        name: '试题管理',
    }
},
{
    path: '/jobsData',
    component: () =>
        import('@/views/layout/Layout.vue'),
    children: [{
        path: '/jobsData',
        name: 'jobsData',
        component: () =>
            import('@/views/jobsData/index.vue')
    }],
    meta: {
        name: '岗位信息管理',
    }
},
{
    path: '/systemManage',
    redirect: '/systemManage/userManage',
    component: () =>
        import('@/views/layout/Layout.vue'),
    meta: {
        name: '系统管理',
        icon: 'icon-xitongguanli',
        dropdown: true //是否有二级菜单
    },
    children: [{
        path: 'userManage',
        name: 'userManage',
        component: () =>
            import('@/views/systemManage/userManage/index.vue'),
        meta: {
            name: '用户管理'
        },
    }, {
        path: 'roleManage',
        name: 'roleManage',
        component: () =>
            import('@/views/systemManage/roleManage/index.vue'),
        meta: {
            name: '角色管理'
        },
    }, {
        path: 'powerManage',
        name: 'powerManage',
        component: () =>
            import('@/views/systemManage/powerManage/index.vue'),
        meta: {
            name: '权限管理'
        },
    }, {
        path: '*',
        name: 'notFound',
        component: () =>
            import('@/views/404.vue'),
        meta: {
            hidden: true
        }
    },
    ]
},]


const router = new Router({
    // mode: 'history',
    base: process.env.BASE_URL,
    routes: constantRouterMap
})

export default router;
